<template>
    <div>
        <h1>添加</h1>
        名称:<input type="text" v-model="form.name">

        <van-button type="primary" @click="add">提交</van-button>

        <h1>展示</h1>
        <table border="1">
            <tr>
                <td>id</td>
                <td>名称</td>
                <td>操作</td>
            </tr>
            <tr v-for="i in stream">
                <td>{{i.id}}</td>
                <td>{{i.name}}</td>
                <td>
                    <van-button>参数</van-button>
                </td>
            </tr>
        </table>
    </div>
</template>

<script>

    export default {
        data(){
            return{
                form:{},
                stream:{}
            }
        },
        methods:{
            add(){
                this.$axios.post('/blue/stream',this.form)
                .then(res=>{
                    if(res.data.code==200){
                        console.log
                        alert('提交成功')
                    }
                })
            },
            get(){
                this.$axios.get('/blue/stream')
                .then(res=>{
                    this.stream = res.data.list
                })
            }
        },
        mounted(){
            this.get()
        }
    }
</script>

<style scoped>

</style>